//package com.lengxf.gateway.bak;
//
//import org.springframework.cloud.gateway.filter.GatewayFilterChain;
//import org.springframework.cloud.gateway.filter.GlobalFilter;
//import org.springframework.core.Ordered;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//import reactor.core.publisher.Mono;
//
///**
// * 缓存请求
// * @Author Lengxf
// */
//@Component
//public class CacheBodyGatewayFilter implements GlobalFilter, Ordered {
//
//
//    @Override
//    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
//        return BodyUtils.cacheRequestBody(exchange, (serverHttpRequest) -> {
//            if (serverHttpRequest == exchange.getRequest()) {
//                return chain.filter(exchange);
//            }
//            return chain.filter(exchange.mutate().request(serverHttpRequest).build());
//        });
//    }
//
//    @Override
//    public int getOrder() {
//        return Ordered.HIGHEST_PRECEDENCE + 1000;
//    }
//}
